libmyc.a:mystdio.o mymath.o
	ar -rc $@ $^
	rm *.o
%.o:%.c
	gcc -c $<

libmyc.so:mystdio.o mymath.o
	gcc -shared -o $@ $^
%.o:%.c
	gcc -c -fPIC $<
#mymath.o:mymath.c
#	gcc -c -fPIC $<
#mystdio.o:mystdio.c
#	gcc -c -fPIC $<

.PHONY:clean
clean:
	rm -rf libmyc.so *.a *.o mylib mylib.tgz

.PHONY:output
output:
	mkdir -p ./mylib/include
	mkdir -p ./mylib/lib
	cp ./*.h ./mylib/include
	cp ./*.so ./mylib/lib
	cp ./*.a ./mylib/lib
	tar czf mylib.tgz mylib

